<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增')" />
</head>
<body  >
<div class="container-div">
    <el-divider content-position="left" style="margin-bottom: 20px">呆滞过期报表</el-divider>
    <el-form  :inline="true"  label-position="left" :model="insert.sluggishOverdue.info" ref="insertForm" label-width="120px" :rules="insert.sluggishOverdue.rules" class="demo-ruleForm">

        <el-form-item   label="物料编码" >
            <el-input v-model="insert.sluggishOverdue.info.itemCode"></el-input>
        </el-form-item>

        <el-form-item   label="物料描述" >
            <el-input v-model="insert.sluggishOverdue.info.itemName"></el-input>
        </el-form-item>

        <el-form-item   label="单位" >
            <el-input v-model="insert.sluggishOverdue.info.unit"></el-input>
        </el-form-item>

        <el-form-item   label="批次" >
            <el-input v-model="insert.sluggishOverdue.info.batch"></el-input>
        </el-form-item>

        <el-form-item label="生产日期" >
            <el-col :span="11">
                <el-date-picker type="date" placeholder="选择日期" value-format="yyyy-MM-dd" v-model="insert.sluggishOverdue.info.productionDate1" style="width: 100%;"></el-date-picker>
            </el-col>
            <el-col :span="11">
                <el-time-picker placeholder="选择时间" value-format="HH:mm:ss" v-model="insert.sluggishOverdue.info.productionDate2" style="width: 100%;"></el-time-picker>
            </el-col>
        </el-form-item>

        <el-form-item label="有效日期" >
            <el-col :span="11">
                <el-date-picker type="date" placeholder="选择日期" value-format="yyyy-MM-dd" v-model="insert.sluggishOverdue.info.exp1" style="width: 100%;"></el-date-picker>
            </el-col>
            <el-col :span="11">
                <el-time-picker placeholder="选择时间" value-format="HH:mm:ss" v-model="insert.sluggishOverdue.info.exp2" style="width: 100%;"></el-time-picker>
            </el-col>
        </el-form-item>

        <el-form-item   label="库存数量" >
            <el-input v-model="insert.sluggishOverdue.info.quantity"></el-input>
        </el-form-item>

        <el-form-item   label="存储天数" >
            <el-input v-model="insert.sluggishOverdue.info.saveDay"></el-input>
        </el-form-item>

        <el-form-item   label="剩余有效期天数" >
            <el-input v-model="insert.sluggishOverdue.info.surplusValidDay"></el-input>
        </el-form-item>

        <el-form-item   label="最后入库日期" >
            <el-input v-model="insert.sluggishOverdue.info.lastTime"></el-input>
        </el-form-item>

        <el-form-item   label="最后出库日期" >
            <el-input v-model="insert.sluggishOverdue.info.lastOutTime"></el-input>
        </el-form-item>

        <el-form-item   label="呆滞类型" >
            <el-input v-model="insert.sluggishOverdue.info.sluggishType"></el-input>
        </el-form-item>

        <el-form-item   label="第一次申报日期" >
            <el-input v-model="insert.sluggishOverdue.info.firstDeclareTime"></el-input>
        </el-form-item>

        <el-form-item   label="第一次申报数量" >
            <el-input v-model="insert.sluggishOverdue.info.firstDeclareQuantity"></el-input>
        </el-form-item>

        <el-form-item   label="消耗数量" >
            <el-input v-model="insert.sluggishOverdue.info.consumeQuantity"></el-input>
        </el-form-item>

    </el-form>
    <div style="margin-left: 40%">
        <el-button type="primary" @click="save()">保存</el-button>
        <el-button type="info" @click="closeModal()">返回</el-button>
    </div>
</div>

<div th:include="include::footer"></div>
<script type="text/javascript" charset="UTF-8">
    var prefix = ctx + "in/boxItem"
    var app = new Vue({
        el: '.container-div',
        data: {
            insert:{
                boxItem:{
                    info:{},
                    rules:{

                    }
                }
            }
        },
        methods:{
            /*关闭此页面*/
            closeModal:function(){
                var index = parent.layer.getFrameIndex(window.name);
                parent.layer.close(index);
            },
            save:function(){
                var that = this;
                /*校验billMaster数据*/
                this.$refs['insertForm'].validate((valid) => {
                    if (valid) {
                        var data = JSON.stringify(that.insert.sluggishOverdue.info)
                        console.log(data)
                        return false;
                        $.ajax({
                            cache : true,
                            type : "POST",
                            url :  "/out/transferRecord/insert",
                            data : data,
                            dataType:"json",
                            contentType: "application/json;charset-UTF-8",
                            async : false,
                            // beforeSend: function () {
                            // 	$.modal.loading("正在处理中，请稍后...");
                            // },
                            error : function(request) {
                                $.modal.alertError("系统错误");
                            },
                            success : function(data) {
                                $.modal.alertSuccess("保存成功！");
                                that.closeModal();
                            }
                        });
                    }else{
                        return false;
                    }
                });
            }
        }
    })
</script>
</body>
</html>
